home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / amos / amcafext.lha / AMCAF_Examples / TdStars2.AMOS / TdStars2.amosSourceCode
AMOS Source Code  |  1995-07-14  |  2KB  |  48 lines

  1. ' ************************************* Commands used: 
  2. ' *                                   * Td Stars Bank      Td Stars Origin 
  3. ' *           Amcaf Examples          * Td Stars Limit     Td Stars Draw 
  4. ' *          Td Stars 2 V1.0          * Td Planes          =Qsin 
  5. ' *      Written by Chris Hodges      * Td Accelerate Off  =Qcos 
  6. ' *                                   * Td Gravity 
  7. ' ************************************* Td Move  
  8. '                          
  9. ' Remove the mousepointer from screen. 
  10. Hide 
  11. ' Open a extra halfbright screen.
  12. Screen Open 0,320,200,64,Lowres
  13. Curs Off : Flash Off : Paper 0 : Pen 1 : Cls 
  14. ' Load a backgroundpicture.
  15. Load Iff "data/beach.iff"
  16. ' Limit the mouse to the screen boundaries.
  17. Wait Vbl : Limit Mouse 
  18. ' Define a bank for the stars. If you have a turbo board, you can increase 
  19. ' the amount of stars. 
  20.  Extension_8_0A7E 9,100
  21. ' Limit the stars to the screen. 
  22.  Extension_8_0A94 
  23. ' Set the planes for usage with Td Stars.
  24. ' This time we use the extra halfbright plane only.
  25.  Extension_8_0BCC 5,5
  26. ' Turn off the acceleration. Test it also with acceleration. 
  27.  Extension_8_0BAE 
  28. ' The next variable is used for the angle. 
  29. W=0
  30. ' Main loop: Repeat until the user presses a key or a mouse button.  
  31. Repeat 
  32.   ' Synchronisize with the raster beam.
  33.   Wait Vbl 
  34.   ' Add the angle. 
  35.   Add W,2
  36.   ' Set the gravity to sine and cosine values. 
  37.    Extension_8_0B78 Extension_8_1114(W,4)-2, Extension_8_1106(W,4)-2
  38.   ' Center the stars to the middle of the screen, but do move it a little bit
  39.   ' circular.
  40.    Extension_8_0AB8 Extension_8_1114(W+512,32)+160, Extension_8_1106(W+512,32)+100
  41.   ' Draw all the stars but don't erase them. 
  42.    Extension_8_0B48 
  43.    Extension_8_0B64 
  44.   ' Swap the screens.
  45.   Screen Swap 
  46. Until Inkey$=Chr$(27) or Mouse Key<>0
  47. Screen Close 0
  48. End